using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace Dracham.GUI.Helpers
{
    public class TextboxKeyboard
    {
        private List<TextboxKeyboardKey> keys;
        public TextboxKeyboard()
        {
            keys = new List<TextboxKeyboardKey>();
            XmlDocument doc = new XmlDocument();
            doc.Load("Data\\TextboxKeyboard.xml");

            foreach (XmlNode keyNode in doc.GetElementsByTagName("Key"))
            {
                keys.Add(new TextboxKeyboardKey(keyNode));
            }

            doc = null;
        }

        public TextboxKeyboardKey GetKey(String key, Boolean shift, Boolean ctrl, Boolean alt)
        {
            foreach (TextboxKeyboardKey k in keys)
            {
                if (k.Key == key && k.Shift == shift && k.Ctrl == ctrl && k.Alt == alt)
                    return k;
            }

            return null;
        }
    }
}
